#ifndef __RELAY_H__
#define __RELAY_H__
#include "gd32f10x.h"

typedef enum
{
    Relay1 = 0,
    Relay2,
    Relay3,
    Relay4,

    RELAY_NUM
}RelayID;

typedef struct 
{
    RelayID  id;
    uint8_t  state;
    uint32_t gpio_periph;
    uint32_t pin;
}RelayObj;

void relay_init(void);
void relay_set(uint8_t relayId, uint8_t state);
void relay_toogle(uint8_t id);
uint8_t get_relay_state(uint8_t relayId);
void relay_self_test(void);

#endif
